import request from "@/utils/request";
/**
 * @description 童车
 * @param
 * @returns
 */
export async function getPrice() {
  return request({
    url: "/babycar/package/list",
    method: "get",
  });
}

export async function savePrice(data: any) {
  return request({
    url: "/babycar/package/update",
    method: "post",
    data: data,
  });
}

export const problemListApi = (data: any) => {
  return request({
    url: "/babycar/problem/list",
    method: "get",
    data: data,
  });
};

//删除问题
export const deleteProblemApi = (problem_id: number) => {
  return request({
    url: "/babycar/problem/del",
    method: "delete",
    data: {
      problem_id,
    },
  });
};

//更新问题
export const updateProblemApi = (data: any) => {
  return request({
    url: "/babycar/problem/update?problem_id=" + data.problem_id,
    method: "post",
    data: data,
  });
};

//新增问题
export const addProblemApi = (data: any) => {
  return request({
    url: "/babycar/problem/add",
    method: "post",
    data: data,
  });
};

//获取站点列表
export const getSiteListApi = (data: any) => {
  return request({
    url: "/babycar/station/list",
    method: "get",
    data: data,
  });
};

//获取负责人列表
export const getManagerListApi = (data?: any) => {
  return request({
    url: "/babycar/manager/list",
    method: "get",
    data: data,
  });
};

//添加站点
export const addSiteApi = (data: any) => {
  return request({
    url: "/babycar/station/create",
    method: "post",
    data: data,
  });
};

//更新站点
export const updateSiteApi = (data: any) => {
  return request({
    url: "/babycar/station/update",
    method: "post",
    data: data,
  });
};

//删除站点
export const deleteSiteApi = (id: number) => {
  return request({
    url: "/babycar/station/del",
    method: "delete",
    data: {
      station_id: id,
    },
  });
};

//订单管理
export const getOrderListApi = (data: any) => {
  return request({
    url: "/babycar/order/list",
    method: "get",
    data: data,
  });
};

//用户管理
export const getUserListApi = (data: any) => {
  return request({
    url: "/babycar/user/list",
    method: "get",
    data: data,
  });
};

//添加负责人
export const addManagerApi = (data: any) => {
  return request({
    url: "/babycar/manager/add",
    method: "post",
    data: data,
  });
};

//更新负责人
export const updateManagerApi = (data: any) => {
  return request({
    url: "/babycar/manager/update",
    method: "post",
    data: data,
  });
};

//删除负责人
export const deleteManagerApi = (id: number) => {
  return request({
    url: "/babycar/manager/del",
    method: "delete",
    data: {
      manager_id: id,
    },
  });
};

//重置密码
export const resetPasswordApi = (data: any) => {
  return request({
    url: "/babycar/manager/resetPassword",
    method: "post",
    data: data,
  });
};
